package com.jycrm.presentation.components.tree;

public class Item implements java.io.Serializable {

    /** serialVersionUID */
    private static final long serialVersionUID = -6014868077202988099L;
    private Folder parent;
    private String id;
    private String name;
    private int level;    
    private boolean checked;

    /**
     * Creates an item
     * @param name
     */
    public Item(String id,String name,int level)
    {
        this(null, id,name,level);
    }
    
    public Item(String id,String name,int level,boolean checked)
    {
        this(null, id,name,level,checked);
    }

    
    /**
     * @return Returns the level.
     */
    public int getLevel(){
        return level;
    }

    
    /**
     * @param level The level to set.
     */
    public void setLevel(int level){
        this.level=level;
    }

    
    /**
     * @param id The id to set.
     */
    public void setId(String id){
        this.id=id;
    }

    
    /**
     * @param name The name to set.
     */
    public void setName(String name){
        this.name=name;
    }

    
    /**
     * @param parent The parent to set.
     */
    public void setParent(Folder parent){
        this.parent=parent;
    }

    /**
     * Creates an item with a parent
     * @param parent
     * @param name
     */
    public Item(Folder parent,String id, String name,int level)
    {
        this.parent = parent;
        this.id=id;
        this.name = name;
        this.level=level;
    }
    
    public Item(Folder parent,String id, String name,int level,boolean checked)
    {
        this.parent = parent;
        this.id=id;
        this.name = name;
        this.level=level;
        this.checked=checked;
    }

    /**
     * Name of item
     * @return
     */
    public String getName()
    {
        return name;
    }
    /**
     * id of item
     * @return
     */
    public String getId()
    {
        return id;
    }
    /**
     * Items parent
     * @return
     */
    public Folder getParent()
    {
        return parent;
    }
    
    /**
     * 
     * {@inheritDoc}
     */
    public String toString()
    {
        return "Item " + getName();
    }


	public boolean isChecked() {
		return checked;
	}

	public void setChecked(boolean checked) {
		this.checked = checked;
	}
    

}